package com.maxcion.scalelayoutmanager.form

import com.maxcion.scalelayoutmanager.adapter.BaseViewHolder
import com.maxcion.scalelayoutmanager.adapter.IMultiItem
import com.maxcion.scalelayoutmanager.adapter.PageLoadMultiRecyclerViewAdapter

class  FormAdapter<T> (val adapterConvert: IAdapterConvert, builder: FormLayoutManager.Builder<T>): PageLoadMultiRecyclerViewAdapter<IMultiItem, BaseViewHolder>(arrayListOf()) {

    init {
        addItemLayout(TYPE_CONTENT, builder.contentLayoutId)
        addItemLayout(TYPE_HORIZONTAL_TITLE, builder.horizontalTitleLayoutId)
    }

    override fun getItemCount(): Int {
        return adapterConvert.getItemCount()
    }

    override fun getItemViewType(position: Int): Int {
        return adapterConvert.getItemViewType(position)
    }

    override fun convert(holder: BaseViewHolder?, position: Int, item: IMultiItem?) {
        adapterConvert.convert(holder!!, position)
    }


}